
export default function debounce(run: (...args: any[]) => void, delay = 800) {
    let timer: number;
    return (...args: any[]) => {
        if (timer) {
            clearTimeout(timer);
        }
        timer = window.setTimeout(() => {
            run(...args);
        }, delay);
    }
}
